export function asEntity(src: any, entityType: any, isFormatHump: boolean = true) {
  const entity = entityType;
  Object.keys(src)
    .forEach((key) => {
      if (isFormatHump) {
        const realKey = formatHump(key);
        entity[realKey] = src[key];
      } else {
        entity[key] = src[key];
      }
    });
}

function formatHump(key: string): string {
  return key.replace(/_([a-z])/g, (_, letter) => letter.toUpperCase());
}
